<?php
header('Content-Type: application/json');

@$isshow= $_REQUEST['isshow'] or die('{"code":-1,"msg":"显示状态不能为空"}');
@$save_time= $_REQUEST['save_time'] or die('{"code":-2,"msg":"显示间隔不能为空"}');
@$title= $_REQUEST['title'] or die('{"code":-3,"msg":"标题不能为空"}');
@$respect= $_REQUEST['respect'] or die('{"code":-4,"msg":"客户名称不能为空"}');
@$content= $_REQUEST['content'] or die('{"code":-5,"msg":"内容不能为空"}');
@$notice_time= $_REQUEST['notice_time'] or die('{"code":-6,"msg":"发布时间不能为空"}');
@$author= $_REQUEST['author'] or die('{"code":-7,"msg":"发布时间不能为空"}');
@$save_cookie= $_REQUEST['save_cookie'] or die('{"code":-8,"msg":"发布时间不能为空"}');

require('init.php');


$sql="UPDATE fs_notice SET isshow='$isshow',save_time='$save_time',title='$title',respect='$respect',content='$content',notice_time='$notice_time',save_cookie='$save_cookie',update_time=now(),author='$author' WHERE nid=1";

$result = mysqli_query($conn,$sql);
if (!$result) {
            printf("Error: %s\n", mysqli_error($conn));
            exit();
        }
if($result==false){
    echo'{"code":2,"msg":"发布公告失败，请检查输入值！"}';
}else{
    echo'{"code":1,"msg":"发布公告成功！"}';
}